package config

type Permission struct {
	Label      string        `json:"label"`
	Permission string        `json:"permission"` // 树形控件的id，叶子节点对应一个唯一的权限
	Children   []*Permission `json:"children,omitempty"`
}

// PermissionTree 后台管理权限树
var PermissionTree = []*Permission{
	{
		Label:      "用户管理",
		Permission: "userAdmin",
		Children: []*Permission{
			{"用户列表", "user:list", nil},
			{"更新用户", "user:update", nil},
		},
	},
	{
		Label:      "商品管理",
		Permission: "goodsAdmin",
		Children: []*Permission{
			{"商品种类列表", "goodsCategory:list", nil},
			{"新增商品种类", "goodsCategory:add", nil},
			{"删除商品种类", "goodsCategory:delete", nil},
			{"更新商品种类", "goodsCategory:update", nil},
			{"商品列表", "goods:list", nil},
			{"新增商品", "goods:add", nil},
			{"删除商品", "goods:delete", nil},
			{"更新商品", "goods:update", nil},
			{"上传商品图片", "goods:uploadGoodsImg", nil},
		},
	},
	{
		Label:      "订单管理",
		Permission: "orderAdmin",
		Children: []*Permission{
			{"订单列表", "order:list", nil},
			{"修改订单状态", "order:orderStatus", nil},
			{"打印订单小票", "order:print", nil},
		},
	},
	{
		Label:      "更新店铺配置",
		Permission: "shopConfig:update",
	},
	{
		Label:      "管理员管理",
		Permission: "sysUserAdmin",
		Children: []*Permission{
			{"管理员列表", "sysUser:list", nil},
			{"新增管理员", "sysUser:add", nil},
			{"删除管理员", "sysUser:delete", nil},
			{"更新原理员", "sysUser:update", nil},
		},
	},
	{
		Label:      "角色管理",
		Permission: "roleAdmin",
		Children: []*Permission{
			{"角色列表", "role:list", nil},
			{"新增角色", "role:add", nil},
			{"删除角色", "role:delete", nil},
			{"更新角色", "role:update", nil},
		},
	},
	{
		Label:      "店铺管理",
		Permission: "shopAdmin",
		Children: []*Permission{
			{"店铺列表", "shop:list", nil},
			{"店铺商家信息", "shop:merchantInfo", nil},
			{"新增店铺", "shop:add", nil},
			{"更新店铺", "shop:update", nil},
		},
	},
}
